import Vue from 'vue'
import Router from 'vue-router'
// import Home from '../components/Home.vue'
// import Yuding from '@/components/tabbar/yuding/yuding.vue'
// import HomePage from '../components/homePage.vue'
// import one from '@/components/tabbar/one'
// import two from '@/components/tabbar/two.vue'
// import three from '@/components/tabbar/three'
// import Attention from '../components/tabbar/attention/attention.vue'
// import four from '@/components/tabbar/four'
// import sj from '../components/tabbar/sj.vue'
// import fxwz from '../components/tyl/fxwz.vue'
// import fxjx from '../components/tyl/fxjx.vue'
// import share from '../components/tyl/share.vue'
// import tzsc from '../components/tyl/tzsc.vue'
// import zjpl from '../components/tyl/zjpl.vue'
// // import diancan from '../components/tabbar/diancan.vue'
// import jiesuan from '../components/tabbar/jiesuan.vue'
// import jiesuanbeizu from '../components/tabbar/jiesuanbeizu.vue'
// import Serch from '../components/tabbar/attention/Serch.vue'
// import Camera from '../components/tabbar/attention/camera.vue'
import allRouter from './routers/allRouter.js'

Vue.use(Router)
const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)

}

const router = new Router({

	mode: 'history',
	base: process.env.BASE_URL,

	routes: [
		...allRouter,

	]

})
//路由守卫
// router.beforeEach((to, from, next)=>{
//   if(to.path == '/login'|| to.path == '/' || to.path == '/four'|| to.path == '/yuding' ){
//     next();
//   }else{
//     if(localStorage.getItem('token')){
//       next();
//     }else{
//     next('/login');
//     }
//   }
// });


export default router
